<template>
  <div>
    <h3>Child</h3>
    <h5>{{ msg }}</h5>
    <button @click="passMsg">走你</button>
  </div>
</template>

<script>
export default {
  props: {
    msg: {
      type: String,
      default: '',
    },
  },
  data() {
    return {
      childMsg: 'child msg',
    }
  },
  methods: {
    passMsg() {
      this.$emit('showMsg', 'child from child')
    },
  },
  mounted() {
    console.log(11, this.$parent)
  },
}
</script>

<style scoped></style>
